﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Farming.EntityFrameworkCore.Migrations
{
    public partial class initDb : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Admins",
                columns: table => new
                {
                    AdminId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    Password = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    LastLoginIp = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    LastLoginTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateById = table.Column<int>(type: "int", nullable: false),
                    CreateByName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyById = table.Column<int>(type: "int", nullable: true),
                    ModifyByName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ModifyTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
                    DeleteById = table.Column<int>(type: "int", nullable: true),
                    DeleteByName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    DeleteTime = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Admins", x => x.AdminId);
                });

            migrationBuilder.InsertData(
                table: "Admins",
                columns: new[] { "AdminId", "CreateById", "CreateByName", "CreateTime", "DeleteById", "DeleteByName", "DeleteTime", "IsDeleted", "LastLoginIp", "LastLoginTime", "ModifyById", "ModifyByName", "ModifyTime", "Password", "UserName" },
                values: new object[] { 1, 1, "Admin", new DateTime(2024, 9, 11, 20, 23, 48, 776, DateTimeKind.Local).AddTicks(8126), null, null, null, false, null, null, null, null, null, "a9a16b601db04ca49bd35de4f0680d12", "Admin" });

            migrationBuilder.InsertData(
                table: "Admins",
                columns: new[] { "AdminId", "CreateById", "CreateByName", "CreateTime", "DeleteById", "DeleteByName", "DeleteTime", "IsDeleted", "LastLoginIp", "LastLoginTime", "ModifyById", "ModifyByName", "ModifyTime", "Password", "UserName" },
                values: new object[] { 2, 1, "Admin", new DateTime(2024, 9, 17, 20, 23, 48, 776, DateTimeKind.Local).AddTicks(8146), null, null, null, false, null, null, null, null, null, "3217f9f826cd4dbda3b41c93ab43a62f", "zhangsan" });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Admins");
        }
    }
}
